package com.aaa.daydemo111.demo1;

import jdk.nashorn.internal.scripts.JO;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月01日9:21
 */
public class TestJoin {
    public static void main(String[] args) throws InterruptedException {
        JoinDemo joinDemo1 = new JoinDemo();
        joinDemo1.start();
        JoinDemo joinDemo2 = new JoinDemo();
        joinDemo2.start();

        joinDemo2.join();
        joinDemo1.join();
        for (int i = 0; i < 20; i++) {
            System.out.println("main==="+i);
        }
    }
}
class JoinDemo extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"====="+i);
        }
    }
}